// pages/deposit/deposit.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    color:'#FF5458',
    color2: '#F0F0F0',
    checked:true,
    inputHidden:true,
    style:1
  },

  /**
   * 生命周期函数--监听页面加载  #019B43
   */
  radio1:function (e) {
    var that = this;
    that.setData({
      color:'#FF5458',
      color2:'#F0F0F0',
      inputHidden:true,
      style:1
    })
  },
  radio2: function (e) {
    var that = this;
    that.setData({
      color2: '#FF5458',
      color:'#F0F0F0',
      inputHidden:false,
      style:2
    })
  },
  onLoad: function (options) {
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  bindFormSubmit: function (e) {
    let style = this.data.style;
    wx.request({
      url: app.d.ceshiUrl + '/Api/Distribution/deposit',
      data: {
        banknum: e.detail.value.banknum,
        wxorpay: e.detail.value.wxorpay,
        bank: e.detail.value.bank,
        money: e.detail.value.money,
        uid: app.d.userId,
        style:style
      },
      method: 'POST',
      header: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        console.log(res)
        if (res.data.status == 1) {
          wx.showToast({
            title: '提交成功！',
            duration: 2000,
          });
          wx.redirectTo({
            url: '../sellBrokerage/sellBrokerage'
          })
        }else{
          wx.showToast({
            title: res.data.err,
            icon:'loading',
            duration: 2000,
          });
        }
      }
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})